# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Datastream.V1.Model.MysqlSourceConfig do
  @moduledoc """
  MySQL source configuration

  ## Attributes

  *   `binaryLogPosition` (*type:* `GoogleApi.Datastream.V1.Model.BinaryLogPosition.t`, *default:* `nil`) - Use Binary log position based replication.
  *   `excludeObjects` (*type:* `GoogleApi.Datastream.V1.Model.MysqlRdbms.t`, *default:* `nil`) - MySQL objects to exclude from the stream.
  *   `gtid` (*type:* `GoogleApi.Datastream.V1.Model.Gtid.t`, *default:* `nil`) - Use GTID based replication.
  *   `includeObjects` (*type:* `GoogleApi.Datastream.V1.Model.MysqlRdbms.t`, *default:* `nil`) - MySQL objects to retrieve from the source.
  *   `maxConcurrentBackfillTasks` (*type:* `integer()`, *default:* `nil`) - Maximum number of concurrent backfill tasks. The number should be non negative. If not set (or set to 0), the system's default value will be used.
  *   `maxConcurrentCdcTasks` (*type:* `integer()`, *default:* `nil`) - Maximum number of concurrent CDC tasks. The number should be non negative. If not set (or set to 0), the system's default value will be used.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :binaryLogPosition => GoogleApi.Datastream.V1.Model.BinaryLogPosition.t() | nil,
          :excludeObjects => GoogleApi.Datastream.V1.Model.MysqlRdbms.t() | nil,
          :gtid => GoogleApi.Datastream.V1.Model.Gtid.t() | nil,
          :includeObjects => GoogleApi.Datastream.V1.Model.MysqlRdbms.t() | nil,
          :maxConcurrentBackfillTasks => integer() | nil,
          :maxConcurrentCdcTasks => integer() | nil
        }

  field(:binaryLogPosition, as: GoogleApi.Datastream.V1.Model.BinaryLogPosition)
  field(:excludeObjects, as: GoogleApi.Datastream.V1.Model.MysqlRdbms)
  field(:gtid, as: GoogleApi.Datastream.V1.Model.Gtid)
  field(:includeObjects, as: GoogleApi.Datastream.V1.Model.MysqlRdbms)
  field(:maxConcurrentBackfillTasks)
  field(:maxConcurrentCdcTasks)
end

defimpl Poison.Decoder, for: GoogleApi.Datastream.V1.Model.MysqlSourceConfig do
  def decode(value, options) do
    GoogleApi.Datastream.V1.Model.MysqlSourceConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Datastream.V1.Model.MysqlSourceConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
